package com.firefly.mobile.app.config;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 各个报文的业务属性配置
 * 
 * @author wowo
 * 
 */
public class PackConfig {

	public static Map<String,List<PackConfig>> payBizPacksMap = new HashMap<String,List<PackConfig>>();
	public static Map<String, PackConfig> configMap = new HashMap<String, PackConfig>();

	
	public static PackConfig getPackConfig(String id,String cardKind) {
		return getConfig(id+"_"+cardKind);
	}

	public static List<PackConfig> getPayBizPacks(String id){
		return payBizPacksMap.get(id);
	}
	
	public void init() {
		configMap.put(id+"_"+cardKind, this);
		if(cardKind!=null&&!cardKind.equals("")){
			incPayBizPack();
		}
	}
	
	private static PackConfig getConfig(String key) {
		return configMap.get(key);
	}
	
	private void incPayBizPack(){
		List<PackConfig> list = payBizPacksMap.get(id);
		if(list==null){
			list = new ArrayList<PackConfig>();
		}
		list.add(this);
		payBizPacksMap.put(id, list);
	}

	private String id; // 业务id
	private String msgType; // 8583报文消息类型
	private String processNo; // 处理码
	private String cardKind; // 支付方式
	private String packId; // 报文id
	private String unPackId; // 解包id
	private String payRoute; //支付通道
	private String payMode; // 支付模式
	private String bizMode; // 业务模式
	private String interfaceVer; // 接口版本号
	private boolean encryptTrack; // 是否磁条加密


	public String getMsgType() {
		return msgType;
	}

	public void setMsgType(String msgType) {
		this.msgType = msgType;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getProcessNo() {
		return processNo;
	}

	public void setProcessNo(String processNo) {
		this.processNo = processNo;
	}

	public String getCardKind() {
		return cardKind;
	}

	public void setCardKind(String cardKind) {
		this.cardKind = cardKind;
	}

	public String getPackId() {
		return packId;
	}

	public void setPackId(String packId) {
		this.packId = packId;
	}

	public boolean isEncryptTrack() {
		return encryptTrack;
	}

	public void setEncryptTrack(boolean encryptTrack) {
		this.encryptTrack = encryptTrack;
	}

	public String getUnPackId() {
		return unPackId;
	}

	public void setUnPackId(String unPackId) {
		this.unPackId = unPackId;
	}

	public String getPayMode() {
		return payMode;
	}

	public void setPayMode(String payMode) {
		this.payMode = payMode;
	}

	public String getBizMode() {
		return bizMode;
	}

	public void setBizMode(String bizMode) {
		this.bizMode = bizMode;
	}

	public String getInterfaceVer() {
		return interfaceVer;
	}

	public void setInterfaceVer(String interfaceVer) {
		this.interfaceVer = interfaceVer;
	}

	public String getPayRoute() {
		return payRoute;
	}

	public void setPayRoute(String payRoute) {
		this.payRoute = payRoute;
	}
	
}
